package com.baseframe.score.feign;

import com.baseframe.score.service.SnsScoreUserService;
import com.baseframe.tool.result.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;


@RestController
@AllArgsConstructor
public class SnsScoreFeignImpl implements SnsScoreFeign{

    private SnsScoreUserService snsScoreUserService;

    @PostMapping(API+"/increase")
    public R<Object> increaseScore(@RequestParam("resultScore") Integer resultScore, @RequestParam("userId") Long userId){

        return snsScoreUserService.increaseScore(userId, resultScore == null ? 0 : resultScore)?R.success():R.fail();
    }

}
